<?php
// 连接数据库
session_start();
include_once ('conn.php');
// 接收表单传过来的账号密码
$username = $_POST['username'];
$password = $_POST['password'];
// 把账号密码查询出来用新的接收
$sql = "select * from `user` where username='$username' and password1='$password'";

$rest = mysqli_query($conn,$sql);

if(mysqli_num_rows($rest)<=0){
    die("用户名/密码错误<a href='login.php'>重新登录</a>");
}
$_SESSION['username']=$username;
echo "登录成功<a href='index.php'>进入首页</a>";

